package com.yehongyu.mytools.ui.applet;

import java.applet.Applet;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.TextField;
import java.util.Hashtable;

public class AutoEvent extends Applet {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6921107522393430907L;

	Hashtable<String,TextField> h = new Hashtable<String,TextField>();

	String[] event = { "keyDown", "keyUp", "lostFocus", "gotFocus",
			"mouseDown", "mouseUp", "mouseMove", "mouseDrag", "mouseEnter",
			"mouseExit" };

	MyButton b1 = new MyButton(this, Color.blue, "test1"), b2 = new MyButton(
			this, Color.red, "test2");

	public void init() {
		setLayout(new GridLayout(event.length + 1, 2));
		for (int i = 0; i < event.length; i++) {
			TextField t = new TextField();
			t.setEditable(false);
			add(new Label(event[i], Label.CENTER));
			add(t);
			h.put(event[i], t);
		}
		add(b1);
		add(b2);
	}
} // /:~
